<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%address}}".
 *
 * @property int $address_id
 * @property int $customer_id
 * @property string $firstname
 * @property string $lastname
 * @property string $company
 * @property string $company_id
 * @property string $tax_id
 * @property string $address_1
 * @property string $address_2
 * @property string $city
 * @property string $postcode
 * @property int $country_id
 * @property int $zone_id
 * @property string $telephone ÁªÏµµç»°
 * @property int $geo_zone_id
 * @property int $placezone_id
 */
class Address extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%address}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['customer_id', 'firstname', 'lastname', 'company', 'company_id', 'tax_id', 'address_1', 'address_2', 'city', 'postcode'], 'required'],
            [['customer_id', 'country_id', 'zone_id', 'geo_zone_id', 'placezone_id'], 'integer'],
            [['firstname', 'lastname', 'company', 'company_id', 'tax_id', 'telephone'], 'string', 'max' => 32],
            [['address_1', 'address_2', 'city'], 'string', 'max' => 128],
            [['postcode'], 'string', 'max' => 10],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'address_id' => Yii::t('app', 'Address ID'),
            'customer_id' => Yii::t('app', 'Customer ID'),
            'firstname' => Yii::t('app', 'Firstname'),
            'lastname' => Yii::t('app', 'Lastname'),
            'company' => Yii::t('app', 'Company'),
            'company_id' => Yii::t('app', 'Company ID'),
            'tax_id' => Yii::t('app', 'Tax ID'),
            'address_1' => Yii::t('app', 'Address 1'),
            'address_2' => Yii::t('app', 'Address 2'),
            'city' => Yii::t('app', 'City'),
            'postcode' => Yii::t('app', 'Postcode'),
            'country_id' => Yii::t('app', 'Country ID'),
            'zone_id' => Yii::t('app', 'Zone ID'),
            'telephone' => Yii::t('app', 'Telephone'),
            'geo_zone_id' => Yii::t('app', 'Geo Zone ID'),
            'placezone_id' => Yii::t('app', 'Placezone ID'),
        ];
    }
}
